package net.wsnetwork.jawa.frontend;

import net.wsnetwork.jawa.common.Server;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

public class FrontendMain {
    public static void main(String[] args) throws Exception {
        MasterClient client = new MasterClient(args[0]);
        client.start();

        Logger.getRootLogger().setLevel(Level.INFO);

        CacheRouter router = new RoundRobinCacheRouter(client);
        Server server = new Server(80, new FrontendConnectionHandler(router), false);
        Server tlsServer = new Server(443, new FrontendConnectionHandler(router), true);
        server.start();
        tlsServer.start();
    }
}
